package com.tanhua.server.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(new TokenInterceptor())
                //拦截所有的请求路径
                .addPathPatterns("/**")
                //其中不包括获取验证码和登录接口
                .excludePathPatterns(new String[]{"/user/login","/user/loginVerification"});
    }
}
